# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rsatool
pkgver=33.c7ef31d
pkgrel=1
pkgdesc='Tool that can be used to calculate RSA and RSA-CRT parameters.'
groups=('blackarch' 'blackarch-crypto')
arch=('any')
url='https://github.com/ius/rsatool'
license=('BSD')
depends=('python' 'python-pyasn1' 'python-gmpy2')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/ius/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  mv "$pkgdir/usr/bin/$pkgname.py" "$pkgdir/usr/bin/$pkgname"
}

